package com.heiye.blog.ai.convert;


import com.heiye.blog.ai.model.dto.TTSRequest;
import com.heiye.blog.ai.model.gptsovits.GPTSoVITSOptions;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

/**
 * @author: heiye
 * @date: 2025/11/20 下午9:35
 * @version: v1.0.0 实体类转换
 * @description:
 */
@Mapper
public interface TTSConvert {
    /**
     * 初始化 convert 实例
     */
    TTSConvert INSTANCE = Mappers.getMapper(TTSConvert.class);

    /**
     * 使用现有对象进行部分更新
     * 只更新非空字段，保留目标对象的原有值
     */
    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void updateGPTSoVITSOptionsFromRequest(TTSRequest request, @MappingTarget GPTSoVITSOptions options);
}
